home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / prefs.dxr / 00005_Button Code.ls < prev    next >
Encoding:
Text File  |  2000-01-14  |  2.5 KB  |  57 lines

  1. global gPrefsVarObj, gIsSoundEffectsOn, gIsRolloverTextOn, gIsAlertMessagesOn
  2.  
  3. on InitButtons
  4.   ButtonList = [:]
  5.   closeb = 3
  6.   addProp(ButtonList, closeb, new(script("close box prefs"), "close box", "global", closeb, the loc of sprite closeb))
  7.   b1 = 5
  8.   b2 = 6
  9.   addProp(ButtonList, b1, new(script("sound effects radio button"), "soundon", "internal", b1, the loc of sprite b1, 1))
  10.   addProp(ButtonList, b2, new(script("sound effects radio button"), "soundoff", "internal", b2, the loc of sprite b2, 0))
  11.   SoundButtonGroup = new(script("radio button group"))
  12.   setGroup(getaProp(ButtonList, b1), SoundButtonGroup)
  13.   setGroup(getaProp(ButtonList, b2), SoundButtonGroup)
  14.   b3 = 7
  15.   b4 = 8
  16.   addProp(ButtonList, b3, new(script("rollover text radio button"), "overtexton", "internal", b3, the loc of sprite b3, 1))
  17.   addProp(ButtonList, b4, new(script("rollover text radio button"), "overtextoff", "internal", b4, the loc of sprite b4, 0))
  18.   RolloverButtonGroup = new(script("radio button group"))
  19.   setGroup(getaProp(ButtonList, b3), RolloverButtonGroup)
  20.   setGroup(getaProp(ButtonList, b4), RolloverButtonGroup)
  21.   b5 = 9
  22.   b6 = 10
  23.   addProp(ButtonList, b5, new(script("alert messages radio button"), "alerton", "internal", b5, the loc of sprite b5, 1))
  24.   addProp(ButtonList, b6, new(script("alert messages radio button"), "alertoff", "internal", b6, the loc of sprite b6, 0))
  25.   AlertButtonGroup = new(script("radio button group"))
  26.   setGroup(getaProp(ButtonList, b5), AlertButtonGroup)
  27.   setGroup(getaProp(ButtonList, b6), AlertButtonGroup)
  28.   spkr = 11
  29.   addProp(ButtonList, spkr, new(script("speaker icon"), "speaker", "internal", spkr, the loc of sprite spkr))
  30.   addProp(ButtonList, 13, new(script("prefs slider"), "slider", "internal", 13, the locH of sprite 13, 65, 199, 1, 8, 1, 8, 0, 0, #upOrLeft))
  31.   repeat with rc in ButtonList
  32.     Inscope(rc)
  33.   end repeat
  34.   if gIsSoundEffectsOn then
  35.     simulateClickOn(getaProp(ButtonList, b1))
  36.   else
  37.     simulateClickOn(getaProp(ButtonList, b2))
  38.   end if
  39.   if gIsRolloverTextOn then
  40.     simulateClickOn(getaProp(ButtonList, b3))
  41.   else
  42.     simulateClickOn(getaProp(ButtonList, b4))
  43.   end if
  44.   if gIsAlertMessagesOn then
  45.     simulateClickOn(getaProp(ButtonList, b5))
  46.   else
  47.     simulateClickOn(getaProp(ButtonList, b6))
  48.   end if
  49.   CurrVolume = the soundLevel + 1
  50.   setThumb(getaProp(ButtonList, 13), CurrVolume)
  51.   SetButtonList(gPrefsVarObj, ButtonList)
  52.   PointingCursor = [member("point hand"), member("point hand mask")]
  53.   repeat with rc in [closeb, spkr]
  54.     set the cursor of sprite rc to PointingCursor
  55.   end repeat
  56. end
  57.